<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>SetFarInfo</title>
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../../styles/styles.css">
<script language="javascript" src='../../links.js' type="text/javascript"></script>
</head>

<body>

<h1>SetFarInfo</h1>
<div class=navbar>
<a href="../../index.html">main</a> |
<a href="../index.html">Custom API</a> |
<a href="index.html">archive support</a>
</div>

<div class=shortdescr>
Called when a subplugin module is loaded and MultiArc passes a
<a href="../../structures/pluginstartupinfo.html">PluginStartupInfo</a> structure pointer to
the plugin. This function is optional and can be omitted.
</div>

<pre class=syntax>
void  WINAPI SetFarInfo(
  const struct PluginStartupInfo *Info
);
</pre>
<h3>Parameters</h3>
<div class=descr>
    <div class=dfn>Info</div>
    <div class=dfndescr>a pointer to a
     <a href="../../structures/pluginstartupinfo.html">PluginStartupInfo</a> structure
    </div>
</div>

<h3>Return value</h3>
<div class=descr>
  <p>None.</p>
</div>

<h3>Remarks</h3>
<div class=descr>
<ol>
<li>
  Function is called only once immediately after
<a href="loadformatmodule.html">LoadFormatModule</a> function call, after which a subplugin knows
about FAR Manager as much as MultiArc plugin itself (plus some additional info from MultiArc).
</li>

<li>
<dfn>Info</dfn> pointer is valid only within the function scope (only inside the function) so the
structure must be copied to subplugin's internal variable for further use:
<pre class=code>static struct PluginStartupInfo Info;
...
void WINAPI _export SetStartupInfo(const struct PluginStartupInfo *Info)
{
  ::Info=*Info;
  ...
}
</pre></li>

<li>
If there're "standard functions" (from <a href="../../fsf/index.html">FarStandardFunctions</a>
structure) used in the plugin then
<a href="../../structures/pluginstartupinfo.html">PluginStartupInfo.FSF</a> member must be saved to
subplugin's local scope as well:
  <pre class=code>static struct PluginStartupInfo Info;
static struct FarStandardFunctions FSF;

void  _export SetStartupInfo(struct PluginStartupInfo *psInfo)
{
    Info=*psInfo;
    FSF=*psInfo-&gt;FSF;
    Info.FSF=&amp;FSF; // correct the address in the local structure
    ...
} </pre></li>
</ol>

</div>

<div class=see>See also:</div><div class=seecont>
<a href="index.html">archive support</a>,
<a href="../../structures/pluginstartupinfo.html">PluginStartupInfo</a>
</div>

</body>
</html>
